Name:	kernel-libre-firmware
Version:	1.3
Release:	1%{?dist}
Summary:	Free firmware for use with the kernel Linux-libre.
License:	GPLv2 and GPLv3+ and MPLv2.0
URL:	https://jxself.org/firmware/
Source0:	https://jxself.org/firmware/linux-libre-firmware-%{version}.tar.lz
Requires:	kernel
Conflicts:	b43-openfwwf

%global debug_package %{nil}

%description
Free firmware for use with the kernel Linux-libre.
Please take some time to read The Importance Of Free Firmware <https://jxself.org/free-firmware.shtml> to learn why this is important.

%prep
rm -rf linux-libre-firmware-%{version}
wget -O- https://jxself.org/firmware/linux-libre-firmware-%{version}.tar.lz | tar x --lzip
rm -rf %{buildroot}
mkdir -p %{buildroot}

%build

%install
cd linux-libre-firmware-%{version}/bin
rm -f %{_tmppath}/kernel-libre-firmware-list
find -not -type d -exec echo $(realpath %{_libdir}/..)/lib/firmware/'{}' ';' | sed -e 's_/./_/_g' > %{_tmppath}/kernel-libre-firmware-list
cd ../src
find -not -type d -exec echo %{_datarootdir}/kernel-libre-firmware/src/'{}' ';' | sed -e 's_/./_/_g' >> %{_tmppath}/kernel-libre-firmware-list
sort %{_tmppath}/kernel-libre-firmware-list -uo %{_tmppath}/kernel-libre-firmware-list
cd ..
mkdir -p %{buildroot}/%{_libdir}/../lib/
mv bin %{buildroot}/%{_libdir}/../lib/firmware
mkdir -p %{buildroot}/%{_datarootdir}/kernel-libre-firmware/
mv src %{buildroot}/%{_datarootdir}/kernel-libre-firmware/

%files -f %{_tmppath}/kernel-libre-firmware-list

%changelog
* Mon Sep 10 2018 Muhammad M. Imtiaz <muhammad.muadh@imtiaz.uk.eu.org> - 1.3-1
- Upgraded to version 1.3 (automatic)

* Mon Sep 10 2018 Muhammad M. Imtiaz <muhammad.muadh@imtiaz.uk.eu.org> - 1.3-1
- Upgraded to version 1.3 (automatic)

* Mon Sep 10 2018 Muhammad M. Imtiaz <muhammad.muadh@imtiaz.uk.eu.org> - 1.3-1
- Upgraded to version 1.3 (automatic)

